Processing text sequences using neural networks

ABSTRACT

Methods, systems, and apparatus, including computer programs encoded on a computer storage medium, for language modeling. In one aspect, a system comprises: a masked convolutional decoder neural network that comprises a plurality of masked convolutional neural network layers and is configured to generate a respective probability distribution over a set of possible target embeddings at each of a plurality of time steps; and a modeling engine that is configured to use the respective probability distribution generated by the decoder neural network at each of the plurality of time steps to estimate a probability that a string represented by the target embeddings corresponding to the plurality of time steps belongs to the natural language.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation application of, and claims priority to, U.S. patent application Ser. No. 16/434,459, filed on Jun. 7, 2019, which is a continuation application of, and claims priority to, U.S. patent application Ser. No. 16/032,971, filed on Jul. 11, 2018, which application is a continuation of PCT Patent Application No. PCT/US2017/058046, filed on Oct. 24, 2017, which application claims the benefit under 35 U.S.C. § 119(e) of U.S. Patent Application No. 62/413,366, filed Oct. 26, 2016. The disclosure of each of the foregoing applications is incorporated herein by reference.

BACKGROUND

This specification relates to processing text sequences using neural networks.

Machine learning models receive an input and generate an output, e.g., a predicted output, based on the received input. Some machine learning models are parametric models and generate the output based on the received input and on values of the parameters of the model.

Some machine learning models are deep models that employ multiple layers of models to generate an output for a received input. For example, a deep neural network is a deep machine learning model that includes an output layer and one or more hidden layers that each apply a non-linear transformation to a received input to generate an output.

SUMMARY

This specification describes a system implemented as computer programs on one or more computers in one or more locations that performs language modeling tasks (e.g., estimating the probability that a string belongs to a given language) or sequence transduction tasks, e.g., translates text from a source language to a target language, performs text summarization, or performs speech recognition. The language modeling tasks may be, e.g., character-level or word-level language modeling tasks.

According to a first aspect there is provided a neural machine translation system for processing text sequences. The system is configured to receive an input sequence of source embeddings representing a source sequence, for example a sequence of words in a source natural language, and to generate an output sequence of target embeddings representing a target sequence, for example a sequence of words that is a translation of the source sequence into a target natural language, the system comprising: a dilated convolutional neural network configured to process the input sequence of source embeddings to generate an encoded representation of the source sequence; and a masked dilated convolutional neural network configured to process the encoded representation of the source sequence to generate the output sequence of target embeddings.

In some implementations, the masked dilated convolutional neural network of the system is configured to generate the output sequence using dynamic unfolding. For example the decoder iteratively generates target embeddings based on previously generated target embeddings and the encoded source representation.

In some implementations, the encoded representation is a matrix that includes a respective column of data for each source embedding, and wherein, at each time step in the output sequence, the masked dilated convolutional network is configured to take as input the corresponding column of the encoded representation and to generate a target embedding.

In some implementations, for each time step that does not have a corresponding column in the encoded representation, the system is configured to add a new column to the encoded representation that corresponds to the time step and set values in the column to zero.

In some implementations, at each time step, the masked dilated convolutional neural network is conditioned on the encoded representation and the target embeddings at time steps before the time step.

In some implementations, the dilated convolutional neural network is configured to preserve a resolution of representations of the source embeddings throughout the dilated convolutional neural network.

In some implementations, the masked dilated convolutional neural network comprises a plurality of one-dimensional masked dilated convolutional neural network layers.

In some implementations, a particular one-dimensional masked dilated convolutional neural network layer is followed by a sub-batch normalization layer, wherein the sub-batch normalization layer is configured to, during training of the neural machine translation system on a batch of training sequences: determine batch normalization statistics of outputs generated by the particular one-dimensional masked dilated convolutional neural network layer for training sequences in an auxiliary sub-batch of the batch of training sequences; and normalize, using the batch normalization statistics, outputs generated by the particular one-dimensional masked dilated convolutional neural network layer for training sequences in a main sub-batch of the batch of training sequences that is different from the auxiliary sub-batch.

In some implementations, one or more of the one-dimensional masked dilated convolutional neural network layers are wrapped in a residual block that contains one or more additional convolutional layers.

In some implementations, the residual block includes a rectified linear unit (ReLU) activation layer.

In some implementations, the residual block includes a multiplicative unit activation layer.

In some implementations, the plurality of one-dimensional masked dilated convolutional neural network layers are grouped into a plurality of groups, and wherein, within each group, the dilation rates of one-dimensional masked dilated convolutional neural network layers in the group are doubled every layer.

In some implementations, each source embedding is a respective bag of n-grams embedding, and wherein, for a given character in the source sequence, the bag of n-grams embedding for the character is a combination of n-gram embeddings of adjacent tokens to the given character in the source sequence.

In some implementations, the bag of n-grams embedding of the given character is a sum of the n-gram embeddings of adjacent n-grams to the given character for n ranging from one to k, wherein k is a predetermined positive integer that is greater than or equal to two.

In some implementations, the system further comprises an input subsystem configured to: receive the source sequence; and generate a sequence of bag of n-grams embeddings from the source sequence.

In some implementations, the dilated convolutional neural network comprises a plurality of one-dimensional dilated convolutional neural network layers that are not masked.

According to a second aspect, there is provided one or more computer storage media encoded with instructions that, when executed by one or more computers, cause the one or more computers to implement the system.

According to a third aspect, there is provided a method comprising: obtaining an input sequence of source embeddings representing a source sequence, for example a sequence of words in a source natural language; and processing the input sequence using the system to generate an output sequence of target embeddings representing a target sequence, for example a sequence of words that is a translation of the source sequence into a target natural language.

Particular embodiments of the subject matter described in this specification can be implemented so as to realize one or more of the following advantages. A neural machine translation system as described in this specification can generate a translation such that the computation time of the system is minimized, i.e., such that the computation time is linear in the lengths of the source and target strings. The neural machine translation system processes inputs such that the resolution of the representation computed by the system stays the maximum possible throughout the computation, improving translation quality. By employing convolutional encoder and decoders, the neural machine translation system can generate translations that have a quality that matches or exceeds the state of the art, while having learning and inference times that are less than those of state of the art systems. For example, as compared to recurrent neural network, e.g., long short-term memory (LSTM), based architectures, the convolutional encoder and decoder do not need to be rolled out for each time step, decreasing the computational footprint required for training and inference. By using bag of n-gram embeddings, the neural machine translation system retains an open vocabulary and is able to predict rare words, proper names, numerical digits, and so on. Moreover, the paths traversed by forwards and backward signals in the neural machine translation system between inputs and outputs are independent of the sequence distance between the inputs and outputs, which allows better signal propagation and long-range dependency learning, thereby improving translation quality.

The details of one or more embodiments of the subject matter of this specification are set forth in the accompanying drawings and the description below. Other features, aspects, and advantages of the subject matter will become apparent from the description, the drawings, and the claims.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows an example neural machine translation system.

FIG. 2 is a flow diagram of an example process for generating a target sequence from a source sequence.

FIG. 3 is a flow diagram of an example process for generating a target sequence using a decoder network.

FIG. 4 is a flow diagram of an example process for sub-batch normalization.

Like reference numbers and designations in the various drawings indicate like elements.

DETAILED DESCRIPTION

This specification describes a system implemented as computer programs on one or more computers in one or more locations that performs language modelling tasks or translates text from a source language to a target language using neural networks.

In particular, for translation, the system is configured to receive an input sequence of source embeddings representing a source sequence of words in a source natural language and to generate an output sequence of target embeddings representing a target sequence of words that is a translation of the source sequence into a target natural language. More generally, the system can be applied to other sequence transduction applications where a source sequence is a mapped to a target sequence.

The system includes a convolutional neural network encoder configured to process the input sequence of source embeddings to generate an encoded representation of the source sequence.

The system also includes a masked convolutional neural network decoder configured to process the encoded representation of the source sequence to generate the output sequence of target embeddings.

FIG. 1 shows an example neural machine translation system 100. The neural machine translation system 100 is an example of a system implemented as computer programs on one or more computers in one or more locations in which the systems, components, and techniques described below are implemented.

The neural machine translation system 100 receives as input a source embedding sequence 106 that is generated by a source embedding model 104 from a source sequence 102 in a source natural language. The sequence is a sequence of words in the source language, with each word made up by one or more characters. (The use of “word” does not exclude the possibility that the input sequence may contain numerals.) In some implementations, the source embedding model 104 can be a bag of n-grams embedding model. (That is, the source embedding model constitutes an input subsystem configured to receive the source sequence 102; and generate a source embedding sequence 106, for example a sequence of bag of n-grams embeddings, from the source sequence.)

The neural machine translation system 100 includes a convolutional neural network encoder 108 that takes as input the source embedding sequence 106 and generates as output an encoded source representation 110.

The encoder 108 has a dilated convolutional architecture and applies one-dimensional convolutions to the source embedding sequence 106. In general, dilated convolutional architectures have the effect of increasing the receptive field size of neurons in a convolutional network, allowing longer range interactions between neurons than would be feasible without dilation. A dilated one-dimensional convolutional layer generates an output by convolving the input with the kernel corresponding to the layer, where the convolution skips inputs according to a step size referred to as the dilation rate. Different dilated convolutional layers within a dilated convolutional network may have different dilation rates. If the dilation rate increases exponentially between layers, then the receptive field size of neurons in the convolutional neural network grows exponentially with the number of layers. In some implementations, the layers of the encoder 108 are assigned to one or more groups, and within each group, the dilation rates of layers in the group are doubled every layer, starting from a dilation rate of 1.

In particular, the encoder 108 generates an encoded source representation 110 that has the same length as the source embedding sequence 106, and thereby preserves the resolution of the source embedding sequence.

The neural machine translation system 100 includes a masked convolutional neural network decoder 112 that takes as input the encoded source representation 110 and generates as output the target embedding sequence 114, which is a representation of the target sequence 116. The target sequence 116 is a sequence of words that is a translation of the source sequence 102 into a target natural language.

Similar to the encoder 108, the decoder 112 has a dilated one-dimensional convolutional architecture, for example the masked dilated convolutional neural network decoder 112 may comprise a plurality of one-dimensional masked dilated convolutional neural network layers (in contrast, the dilated convolutional neural network encoder 108 may comprise a plurality of one-dimensional dilated convolutional neural network layers that are not masked). In general, the masked convolutional architecture of the decoder 112 ensures that the decoder does not rely on target embeddings generated at future time steps in order to generate a target embedding at a given time step. In some implementations, the layers of the decoder 112 are assigned to one or more groups, and within each group, the dilation rates of layers in the group are doubled every layer, starting from a dilation rate of 1.

The decoder 112 generates variable length target embedding sequences 114 by dynamic unfolding, where the decoder iteratively generates target embeddings based on previously generated target embeddings and the encoded source representation, for example until the decoder generates an end-of-sequence (EOS) token.

In addition to the dilated masked convolutional layers, the decoder 112 may also contain sub-batch normalization layers. That is, in these implementations, one or more of the one-dimensional masked convolutional layers of the decoder are followed by a sub-batch normalization layer. The operation of sub-batch normalization layers is described below with reference to process 400 of FIG. 4.

An example process for generating a target sequence from a source sequence using the encoder and decoder neural networks is described in more detail below with reference to FIG. 2.

The masked convolutional neural network decoder 112 can be used to perform language modeling tasks independently of the convolutional neural network encoder 108. In a language modeling task, the masked convolutional neural network decoder 112 functions as a language model for the target language. That is, the masked convolutional decoder neural network 112 can be used to estimate the probability that a string belongs to a given language, e.g., is a valid string in that language.

FIG. 2 is a flow diagram of an example process 200 for generating a target sequence from a source sequence. For convenience, the process 200 will be described as being performed by a system of one or more computers located in one or more locations. For example, a neural machine translation system, e.g., the neural machine translation system 100 of FIG. 1, appropriately programmed in accordance with this specification, can perform the process 200.

The system generates a sequence of source embeddings from a source sequence of text in a source natural language using a source embedding model (step 202). In particular, the system sequentially maps characters in the source natural language to corresponding source embedding vectors.

In some implementations, the source embedding model maps a character in the source natural language to a corresponding source embedding vector based only on the character itself. In some other implementations, the source embedding model maps words in the source sequence to corresponding source embedding vectors. In some other implementations, the source embedding model is a bag of n-grams embedding model and maps a character in the source natural language to a corresponding source embedding vector based on n-grams of characters adjacent to the given character, for n ranging from one to k, where k is a predetermined positive integer that is greater than or equal to two. For example, the source embedding model may first associate each n-gram of characters adjacent to the given character to respective n-gram embedding vectors, and generate the source embedding vector by adding the respective n-gram embedding vectors. As another example, the source embedding model may first associate each n-gram of characters adjacent to the given character to respective n-gram embedding vectors, and generate the source embedding vector by concatenating the respective n-gram embedding vectors.

Next, the system provides the sequence of source embeddings as input to a convolutional neural network encoder that generates as output an encoded source representation (step 204). In general, the encoder is configured to generate an encoded source representation with the same length as the source embedding sequence. Therefore, the encoded source representation does not have a fixed length, because the length of the encoded source representation is determined by the length of the source embedding sequence, which varies between source sequences. In general, the encoder is configured to generate an encoded source representation that is a matrix that includes a respective column of data for each source embedding in the sequence of source embeddings.

In particular, the convolutional neural network encoder includes a stack of dilated convolutional neural network layers and generates the encoded source representation by processing the sequence of source embeddings through the stack of dilated convolutional neural network layers. As described above, in some implementations, the layers of the encoder are assigned to one or more groups, and within each group, the dilation rates of layers in the group are doubled every layer, starting from a dilation rate of 1. In some implementations where the source embedding model associates each n-gram of characters adjacent to the given character in the source sequence to respective n-gram embedding vectors and generates the source embedding vector by concatenating the respective n-gram embedding vectors, the first layer of the encoder is a 1×1 convolutional layer.

Next, the system provides the encoded source representation as input to a masked convolutional neural network decoder that generates as output a sequence of target embeddings (step 206).

The decoder generates the output sequence of target embeddings using dynamic unfolding. An example process for generating the output sequence of target embeddings using dynamic unfolding is described below with reference to process 300 of FIG. 3.

Next, the system processes the sequence of target embeddings to generate a target sequence in the target natural language that is a translation of the source sequence in the source natural language (step 208). In general, the system generates the target sequence in the target natural language by sequentially mapping target embeddings to characters or words in the target natural language.

FIG. 3 is a flow diagram of an example process 300 for generating a target sequence using a decoder network. For convenience, the process 300 will be described as being performed by a system of one or more computers located in one or more locations. For example, a neural machine translation system, e.g., the neural machine translation system 100 of FIG. 1, appropriately programmed in accordance with this specification, can perform the process 300.

The process 300 describes an iterative process performed by the system that sequentially generates a respective target embedding at each iteration. The iterations are performed in sequence, so in the following, each iteration is referred to as a time step for convenience.

The system determines whether the encoded representation of the sequence of source embeddings has a corresponding column for the time step (step 302) (as noted, the encoded representation may be a matrix that includes a respective column of data for each source embedding in the sequence of source embeddings). In response to determining that the encoded representation does not have a corresponding column for the time step, the system identifies a column of zeros as the corresponding column of the encoded representation for the time step (step 304). The encoded representation might not have a corresponding column for the time step if, for example, the sequence of target embeddings is longer than the sequence of source embeddings. In response to determining that the encoded representation does have a corresponding column for the time step, the system refrains from modifying the encoded representation.

Next, the system concatenates the target embeddings generated at previous time steps and provides the concatenated target embeddings and the corresponding column of the encoded representation of the sequence of source embeddings for the time step as inputs to the masked one-dimensional convolutional neural network decoder for the current time step (step 306). The decoder is configured to generate as output probabilities for a set of possible target embeddings for the time step. The system samples a target embedding from set of possible target embeddings in accordance with the probabilities or selects the target embedding with the highest probability as the target embedding for the time step. For example, the final layer of the decoder maybe a softmax output layer that generates the probabilities.

In general, to ensure that the decoder does not depend on future target embeddings that have not been generated at a given time step to generate the target embedding for the given time step, the decoder implements masked convolutions. In some implementations, one-dimensional masked convolutions are implemented by zeroing out some of the weights of the convolutional kernels.

For the first time step, when no target embeddings have been generated at previous time steps, the input to the decoder is only the corresponding column of the encoded representation of the source embedding.

The system may provide the target embeddings and the corresponding column of the encoded representation as input to the decoder in any of a variety of ways. For example, the system can concatenate the target embeddings and the corresponding column of the encoded representation. As another example, the system can add the corresponding column to the target embeddings. As yet another example, the decoder can first process the target embeddings using one or more initial neural network layers, e.g., one or more 1×1 convolutional layers, and then add the column to the output of the initial neural network layers.

Next, the system determines whether the target embedding generated by the decoder is the end-of-sequence (EOS) symbol (step 310). In response to determining that the generated target embedding is the EOS symbol, the sequence of target embeddings is output (step 312). In response to determining that the generated target embedding is not the EOS symbol, the process 300 returns to step 302 and repeats the preceding steps.

The system can run the encoder and the decoder in parallel, where at each time step, the encoder generates the corresponding column of the encoded source representation, and the decoder processes the corresponding column of the source representation and the previously generated target embeddings to generate the target embedding for the time step.

The system can perform the processes 200 and 300 for source sequence inputs for which the desired output, i.e., the target sequence that translates the source sequence from a source natural language into a target natural language, is not known. The system can also perform the processes 200 and 300 on source sequence inputs in a set of training data, i.e., a set of inputs for which the target sequence that should be generated by the system is known, in order to determine trained values for the parameters of the layers of the encoder and the decoder. The processes 200 and 300 are iteratively performed on inputs selected from a set of training data as part of a conventional machine learning training technique to train the layers.

The machine learning training technique to train the layers may be stochastic gradient descent with backpropagation, where the system selects subsets of the training data, referred to as “batches”, the system generates predicted target sequences corresponding to the source sequences in the batch, and the system adjusts the values of the parameters of the layers of the encoder and decoder to improve the performance of the system according to a performance measure by backpropagation.

In some implementations, one or more of the one-dimensional masked convolutional layers of the decoder are followed by a sub-batch normalization layer. The operation of sub-batch normalization layers is described with reference to process 400 of FIG. 4, to which we now turn.

FIG. 4 is a flow diagram of an example process 400 for sub-batch normalization. For convenience, the process 400 will be described as being performed by a system of one or more computers located in one or more locations. For example, a neural machine translation system, e.g., the neural machine translation system 100 of FIG. 1, appropriately programmed in accordance with this specification, can perform the process 400.

During a training iteration, for a given batch of source-target sequence pairs, the system divides the batch into a main sub-batch and an auxiliary sub-batch (step 402). For example, the batch may be randomly or arbitrarily divided into a main sub-batch and an auxiliary sub-batch of respective fixed sizes.

The system determines batch normalization statistics for the inputs to the sub-batch normalization layer for sequences in the auxiliary sub-batch of sequences (step 404). The batch normalization statistics may include the mean and variance of the inputs to the sub-batch normalization layer.

The system normalizes, using the batch normalization statistics for the auxiliary sub-batch, the inputs to the sub-batch normalization layer for sequences in both the auxiliary sub-batch and the main sub-batch (step 406).

The system outputs, from the sub-batch normalization layer, the normalized inputs to the sub-batch normalization layer (step 408), i.e., as input to another layer in the decoder, e.g., a dilated masked convolutional layer.

During training of the system with sub-batch normalization, backpropagation is performed at each iteration based only on the predicted target sequences for the main sub-batch, while the predicted target sequences for the auxiliary sub-batch are ignored in performing backpropagation.

Sub-batch normalization layers differ from conventional batch normalization layers, which do not divide the batch into a main sub-batch and an auxiliary sub-batch, but rather determine the batch normalization statistics based on the whole batch. The calculation of batch normalization statistics takes into account inputs to the batch normalization layer along all the target embeddings in the target embedding sequence, and therefore normalizing the inputs to the batch normalization layer with the batch normalization statistics violates the conditioning structure of the decoder. Using sub-batch normalization layers however, batch normalization statistics are computed based on the auxiliary sub-batch and not the main sub-batch, so the conditioning structure of the decoder is preserved for sequences in the main sub-batch, and backpropagation is performed based on the predicted sequences for the main sub-batch and not the auxiliary sub-batch.

In some implementations, one or more of the layers of the convolutional neural network encoder and/or decoder are wrapped in a residual block that contains one or more additional convolutional layers. In general, residual blocks enable more effective training of neural networks by adding the input to the residual block to the output of the residual block, allowing the layers inside the residual block to learn incremental representations. In some implementations, the residual block includes a rectified linear unit (ReLU) activation layer. In other implementations, the residual block includes a multiplicative unit activation layer.

This specification uses the term “configured” in connection with systems and computer program components. For a system of one or more computers to be configured to perform particular operations or actions means that the system has installed on it software, firmware, hardware, or a combination of them that in operation cause the system to perform the operations or actions. For one or more computer programs to be configured to perform particular operations or actions means that the one or more programs include instructions that, when executed by data processing apparatus, cause the apparatus to perform the operations or actions.

Embodiments of the subject matter and the functional operations described in this specification can be implemented in digital electronic circuitry, in tangibly-embodied computer software or firmware, in computer hardware, including the structures disclosed in this specification and their structural equivalents, or in combinations of one or more of them. Embodiments of the subject matter described in this specification can be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a tangible non-transitory storage medium for execution by, or to control the operation of, data processing apparatus. The computer storage medium can be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of them. Alternatively or in addition, the program instructions can be encoded on an artificially-generated propagated signal, e.g., a machine-generated electrical, optical, or electromagnetic signal, that is generated to encode information for transmission to suitable receiver apparatus for execution by a data processing apparatus.

The term “data processing apparatus” refers to data processing hardware and encompasses all kinds of apparatus, devices, and machines for processing data, including by way of example a programmable processor, a computer, or multiple processors or computers. The apparatus can also be, or further include, special purpose logic circuitry, e.g., an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit). The apparatus can optionally include, in addition to hardware, code that creates an execution environment for computer programs, e.g., code that constitutes processor firmware, a protocol stack, a database management system, an operating system, or a combination of one or more of them.

A computer program, which may also be referred to or described as a program, software, a software application, an app, a module, a software module, a script, or code, can be written in any form of programming language, including compiled or interpreted languages, or declarative or procedural languages; and it can be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment. A program may, but need not, correspond to a file in a file system. A program can be stored in a portion of a file that holds other programs or data, e.g., one or more scripts stored in a markup language document, in a single file dedicated to the program in question, or in multiple coordinated files, e.g., files that store one or more modules, sub-programs, or portions of code. A computer program can be deployed to be executed on one computer or on multiple computers that are located at one site or distributed across multiple sites and interconnected by a data communication network.

In this specification the term “engine” is used broadly to refer to a software-based system, subsystem, or process that is programmed to perform one or more specific functions. Generally, an engine will be implemented as one or more software modules or components, installed on one or more computers in one or more locations. In some cases, one or more computers will be dedicated to a particular engine; in other cases, multiple engines can be installed and running on the same computer or computers.

The processes and logic flows described in this specification can be performed by one or more programmable computers executing one or more computer programs to perform functions by operating on input data and generating output. The processes and logic flows can also be performed by special purpose logic circuitry, e.g., an FPGA or an ASIC, or by a combination of special purpose logic circuitry and one or more programmed computers.

Computers suitable for the execution of a computer program can be based on general or special purpose microprocessors or both, or any other kind of central processing unit. Generally, a central processing unit will receive instructions and data from a read-only memory or a random access memory or both. The essential elements of a computer are a central processing unit for performing or executing instructions and one or more memory devices for storing instructions and data. The central processing unit and the memory can be supplemented by, or incorporated in, special purpose logic circuitry. Generally, a computer will also include, or be operatively coupled to receive data from or transfer data to, or both, one or more mass storage devices for storing data, e.g., magnetic, magneto-optical disks, or optical disks. However, a computer need not have such devices. Moreover, a computer can be embedded in another device, e.g., a mobile telephone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a Global Positioning System (GPS) receiver, or a portable storage device, e.g., a universal serial bus (USB) flash drive, to name just a few.

Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media and memory devices, including by way of example semiconductor memory devices, e.g., EPROM, EEPROM, and flash memory devices; magnetic disks, e.g., internal hard disks or removable disks; magneto-optical disks; and CD-ROM and DVD-ROM disks.

To provide for interaction with a user, embodiments of the subject matter described in this specification can be implemented on a computer having a display device, e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor, for displaying information to the user and a keyboard and a pointing device, e.g., a mouse or a trackball, by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback, e.g., visual feedback, auditory feedback, or tactile feedback; and input from the user can be received in any form, including acoustic, speech, or tactile input. In addition, a computer can interact with a user by sending documents to and receiving documents from a device that is used by the user; for example, by sending web pages to a web browser on a user's device in response to requests received from the web browser. Also, a computer can interact with a user by sending text messages or other forms of message to a personal device, e.g., a smartphone that is running a messaging application, and receiving responsive messages from the user in return.

Data processing apparatus for implementing machine learning models can also include, for example, special-purpose hardware accelerator units for processing common and compute-intensive parts of machine learning training or production, i.e., inference, workloads.

Machine learning models can be implemented and deployed using a machine learning framework, e.g., a TensorFlow framework, a Microsoft Cognitive Toolkit framework, an Apache Singa framework, or an Apache MXNet framework.

Embodiments of the subject matter described in this specification can be implemented in a computing system that includes a back-end component, e.g., as a data server, or that includes a middleware component, e.g., an application server, or that includes a front-end component, e.g., a client computer having a graphical user interface, a web browser, or an app through which a user can interact with an implementation of the subject matter described in this specification, or any combination of one or more such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication, e.g., a communication network. Examples of communication networks include a local area network (LAN) and a wide area network (WAN), e.g., the Internet.

The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. In some embodiments, a server transmits data, e.g., an HTML page, to a user device, e.g., for purposes of displaying data to and receiving user input from a user interacting with the device, which acts as a client. Data generated at the user device, e.g., a result of the user interaction, can be received at the server from the device.

While this specification contains many specific implementation details, these should not be construed as limitations on the scope of any invention or on the scope of what may be claimed, but rather as descriptions of features that may be specific to particular embodiments of particular inventions. Certain features that are described in this specification in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination. Moreover, although features may be described above as acting in certain combinations and even initially be claimed as such, one or more features from a claimed combination can in some cases be excised from the combination, and the claimed combination may be directed to a subcombination or variation of a subcombination.

Similarly, while operations are depicted in the drawings and recited in the claims in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. In certain circumstances, multitasking and parallel processing may be advantageous. Moreover, the separation of various system modules and components in the embodiments described above should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.

Particular embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. For example, the actions recited in the claims can be performed in a different order and still achieve desirable results. As one example, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some cases, multitasking and parallel processing may be advantageous. 

What is claimed is:
 1. A neural sequence transduction system implemented by one or more computers that is configured to perform a text processing machine learning task or a speech processing machine learning task, the neural sequence transduction system comprising: a convolutional encoder neural network configured to: receive an input sequence of source embeddings representing a source sequence of data elements, wherein the source sequence of data elements is a source sequence of words or a source sequence of speech; and process the input sequence of source embeddings to generate an encoded representation of the source sequence; and a masked convolutional decoder neural network configured to: receive the encoded representation of the source sequence generated by the convolutional encoder neural network; and process the encoded representation of the source sequence to generate an output sequence of target embeddings representing a target sequence of data elements that corresponds to the source sequence of data elements, wherein, by generating the target sequence of data elements from the source sequence of data elements, the convolutional encoder neural network and the masked convolutional decoder neural network jointly perform the text processing machine learning task or the speech processing machine learning task.
 2. The system of claim 1, wherein the encoder neural network comprises a plurality of one-dimensional dilated convolutional neural network layers that are not masked.
 3. The system of claim 1, wherein the source sequence of words are in a source natural language, and the target sequence of data elements is a target sequence of words in a target natural language that is a translation of the source sequence of words into the target natural language.
 4. The system of claim 3, wherein each source embedding is a respective bag of n-grams embedding, and wherein, for a given character in the source sequence, the bag of n-grams embedding for the character is a combination of n-gram embeddings of adjacent characters to the given character in the source sequence.
 5. The system of claim 4, wherein the bag of n-grams embedding of the given character is a sum of the n-gram embeddings of adjacent n-grams to the given character for n ranging from one to k, wherein k is a predetermined positive integer that is greater than or equal to two.
 6. The system of claim 4, further comprising: an input subsystem configured to: receive the source sequence; and generate a sequence of bag of n-grams embeddings from the source sequence.
 7. The system of claim 1, wherein the decoder neural network comprises a plurality of one-dimensional masked dilated convolutional neural network layers.
 8. The system of claim 1, wherein the encoder neural network is configured to preserve a resolution of representations of the source embeddings throughout the encoder neural network.
 9. The system of claim 7, wherein the plurality of one-dimensional masked dilated convolutional neural network layers are grouped into a plurality of groups, and wherein, within each group, dilation rates of one-dimensional masked dilated convolutional neural network layers in the group are doubled every layer.
 10. The system of claim 7, wherein a particular one-dimensional masked dilated convolutional neural network layer is followed by a sub-batch normalization layer, wherein the sub-batch normalization layer is configured to, during training of the system on a batch of training sequences: determine batch normalization statistics of outputs generated by the particular one-dimensional masked dilated convolutional neural network layer for training sequences in an auxiliary sub-batch of the batch of training sequences; and normalize, using the batch normalization statistics, outputs generated by the particular one-dimensional masked dilated convolutional neural network layer for training sequences in a main sub-batch of the batch of training sequences that is different from the auxiliary sub-batch.
 11. The system of claim 7, wherein one or more of the one-dimensional masked dilated convolutional neural network layers are wrapped in a residual block that contains one or more additional convolutional layers.
 12. The system of claim 11, wherein the residual block includes a rectified linear unit (ReLU) activation layer.
 13. The system of claim 11, wherein the residual block includes a multiplicative unit activation layer.
 14. The system of claim 1, wherein the decoder neural network is configured to generate the output sequence using dynamic unfolding.
 15. The system of claim 14, wherein the encoded representation is a matrix that includes a respective column of data for each source embedding, and wherein, at each time step in the output sequence, the decoder neural network is configured to take as input a corresponding column of the encoded representation and to generate a target embedding.
 16. The system of claim 15, wherein for each time step that does not have a corresponding column in the encoded representation, the system is configured to add a new column to the encoded representation that corresponds to the time step and set values in the column to zero.
 17. The system of claim 15, wherein at each time step, the decoder neural network is conditioned on the encoded representation and the target embeddings at time steps before the time step.
 18. A method performed by one or more data processing apparatus for performing a text processing machine learning task or a speech processing machine learning task, the method comprising: obtaining an input sequence of source embeddings representing a source sequence of data elements, wherein the source sequence of data elements is a source sequence of words or a source sequence of speech; and processing the input sequence to generate an output sequence of target embeddings representing a target sequence of data elements that corresponds to the source sequence of data elements, the processing comprising: processing the input sequence of source embeddings using a convolutional encoder neural network to generate an encoded representation of the source sequence; and processing the encoded representation of the source sequence using a masked convolutional decoder neural network to generate the output sequence of target embeddings, wherein, by generating the target sequence of data elements from the source sequence of data elements, the convolutional encoder neural network and the masked convolutional decoder neural network jointly perform the text processing machine learning task or the speech processing machine learning task.
 19. A non-transitory computer readable storage medium storing instructions executable by a data processing apparatus and that upon such execution causes the data processing apparatus to perform operations of a text processing machine learning task or a speech processing machine learning task, the operations comprising: obtaining an input sequence of source embeddings representing a source sequence of data elements, wherein the source sequence of data elements is a source sequence of words or a source sequence of speech; and processing the input sequence to generate an output sequence of target embeddings representing a target sequence of data elements that corresponds to the source sequence of data elements, the processing comprising: processing the input sequence of source embeddings using a convolutional encoder neural network to generate an encoded representation of the source sequence; and processing the encoded representation of the source sequence using a masked convolutional decoder neural network to generate the output sequence of target embeddings, wherein, by generating the target sequence of data elements from the source sequence of data elements, the convolutional encoder neural network and the masked convolutional decoder neural network jointly perform the text processing machine learning task or the speech processing machine learning task. 